package com.diudiutechnology.www.yadiudiu.util.http;

import com.diudiutechnology.www.yadiudiu.yadiudiu.model.AddThePropertyModel;
import com.diudiutechnology.www.yadiudiu.yadiudiu.model.AllEvaluationModel;
import com.diudiutechnology.www.yadiudiu.yadiudiu.model.ApplicationModel;
import com.diudiutechnology.www.yadiudiu.yadiudiu.model.ApplyForEntryStatusModel;
import com.diudiutechnology.www.yadiudiu.yadiudiu.model.BusinessCenterModel;
import com.diudiutechnology.www.yadiudiu.yadiudiu.model.BuyAcarModel;
import com.diudiutechnology.www.yadiudiu.yadiudiu.model.CollectionModel;
import com.diudiutechnology.www.yadiudiu.yadiudiu.model.CommodityManagementModel;
import com.diudiutechnology.www.yadiudiu.yadiudiu.model.CustomerServiceCenterModel;
import com.diudiutechnology.www.yadiudiu.yadiudiu.model.EducationModel;
import com.diudiutechnology.www.yadiudiu.yadiudiu.model.FamilyManagementModel;
import com.diudiutechnology.www.yadiudiu.yadiudiu.model.HomePageModel;
import com.diudiutechnology.www.yadiudiu.yadiudiu.model.HousingModel;
import com.diudiutechnology.www.yadiudiu.yadiudiu.model.ImageManagementModel;
import com.diudiutechnology.www.yadiudiu.yadiudiu.model.MerchantsTypeModel;
import com.diudiutechnology.www.yadiudiu.yadiudiu.model.MessageActivityModel;
import com.diudiutechnology.www.yadiudiu.yadiudiu.model.MineFragmentModel;
import com.diudiutechnology.www.yadiudiu.yadiudiu.model.OrderDetailsModel;
import com.diudiutechnology.www.yadiudiu.yadiudiu.model.RedPacketsModel;
import com.diudiutechnology.www.yadiudiu.yadiudiu.model.RegistrationModel;
import com.diudiutechnology.www.yadiudiu.yadiudiu.model.SelectBankCardModel;
import com.diudiutechnology.www.yadiudiu.yadiudiu.model.ShippingAddressModel;
import com.diudiutechnology.www.yadiudiu.yadiudiu.model.SignIntegralModel;
import com.diudiutechnology.www.yadiudiu.yadiudiu.model.UniversalModel;
import com.diudiutechnology.www.yadiudiu.yadiudiu.model.WaitingModel;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2017/8/21.
 */

public class JsonTools {
    //短信  注册  登录  找回密码
    public static List<RegistrationModel> getnote(
            String ULR) {
        if ("".equals(ULR)) {

            return null;
        }
        List<RegistrationModel> list = new ArrayList<>();

        JSONObject jsonObject;
        try {
            jsonObject = new JSONObject(ULR);
            RegistrationModel model = new RegistrationModel();
            model.setStatus(jsonObject.optString("status"));
            model.setMsg(jsonObject.optString("msg"));
            if (jsonObject.optString("userid") != null) {//登录接口才有反回值
                model.setUserid(jsonObject.optString("userid"));
            }
            if (jsonObject.optString("token") != null) {//登录接口才有反回值
                model.setToken(jsonObject.optString("token"));
            }
            if (jsonObject.optString("content") != null) {//个人中心首页借口
                model.setContent(jsonObject.optString("content"));
            }
            list.add(model);
        } catch (JSONException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

        return list;

    }

    //解析底层
    public static List<RegistrationModel> getunderlying(
            String ULR) {
        if ("".equals(ULR)) {
            return null;
        }
        List<RegistrationModel> list = new ArrayList<>();
        JSONObject jsonObject;
        try {
            jsonObject = new JSONObject(ULR);
            RegistrationModel model = new RegistrationModel();
            model.setStatus(jsonObject.optString("status"));
            model.setMsg(jsonObject.optString("msg"));
            if (jsonObject.optString("content") != null) {//个人中心首页借口
                model.setContent(jsonObject.optString("content"));
            }
            if (jsonObject.optString("problem") != null) {//
                model.setProblem(jsonObject.optString("problem"));
            }
            if (jsonObject.optString("info") != null) {//
                model.setInfo(jsonObject.optString("info"));
            }
            if (jsonObject.optString("sign") != null) {//
                model.setSign(jsonObject.optString("sign"));
            }
            if (jsonObject.optString("signintegral") != null) {//
                model.setSignintegral(jsonObject.optString("signintegral"));
            }
            if (jsonObject.optString("userScore") != null) {//
                model.setUserScore(jsonObject.optString("userScore"));
            }
            if (jsonObject.optString("allmoney") != null) {//
                model.setAllmoney(jsonObject.optString("allmoney"));
            }
            if (jsonObject.optString("grabARedEnvelope") != null) {//
                model.setGrabARedEnvelope(jsonObject.optString("grabARedEnvelope"));
            }
            if (jsonObject.optString("movableRedEnvelope") != null) {//
                model.setMovableRedEnvelope(jsonObject.optString("movableRedEnvelope"));
            }
            if (jsonObject.optString("money") != null) {//
                model.setMoney(jsonObject.optString("money"));
            }
            if (jsonObject.optString("serviceCharge") != null) {//
                model.setServiceCharge(jsonObject.optString("serviceCharge"));
            }

            if (jsonObject.optString("creditscore") != null) {//
                model.setCreditscore(jsonObject.optString("creditscore"));
            }
            if (jsonObject.optString("consumerpoints") != null) {//
                model.setConsumerpoints(jsonObject.optString("consumerpoints"));
            }
            if (jsonObject.optString("eachcheckin") != null) {//
                model.setEachcheckin(jsonObject.optString("eachcheckin"));
            }
            if (jsonObject.optString("getpoints") != null) {//
                model.setGetpoints(jsonObject.optString("getpoints"));
            }

            list.add(model);
        } catch (JSONException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return list;
    }

    //个人中心
    public static List<MineFragmentModel> getMine(
            String ULR) {
        if ("".equals(ULR)) {
            return null;
        }
        List<MineFragmentModel> list = new ArrayList<>();
        JSONObject jsonObject;
        try {
            jsonObject = new JSONObject(ULR);
            MineFragmentModel model = new MineFragmentModel();
            model.setId(jsonObject.optString("id"));
            model.setAvatar(jsonObject.optString("avatar"));
            model.setNickname(jsonObject.optString("nickname"));
            model.setPhone(jsonObject.optString("phone"));
            model.setBalance(jsonObject.optString("balance"));
            model.setPassword(jsonObject.optString("password"));
            model.setRedenvelope(jsonObject.optString("redenvelope"));
            model.setPoints(jsonObject.optString("points"));
            model.setCreditscore(jsonObject.optString("creditscore"));
            model.setCreditrating(jsonObject.optString("creditrating"));
            model.setInvitecode(jsonObject.optString("invitecode"));
            model.setBeinvitedcode(jsonObject.optString("beinvitedcode"));
            model.setCurrentprovince(jsonObject.optString("currentprovince"));
            model.setCurrentcity(jsonObject.optString("currentcity"));
            model.setCurrentdist(jsonObject.optString("currentdist"));
            model.setCurrentsuite(jsonObject.optString("currentsuite"));
            model.setIs_educationcerti(jsonObject.optString("is_educationcerti"));
            model.setRealname(jsonObject.optString("realname"));
            model.setIdcardno(jsonObject.optString("idcardno"));
            model.setFrontofidcard(jsonObject.optString("frontofidcard"));
            model.setIdcardnegative(jsonObject.optString("idcardnegative"));
            model.setDrivinglicense(jsonObject.optString("drivinglicense"));
            model.setDrivinglicenseback(jsonObject.optString("drivinglicenseback"));
            model.setDrivingpermitface(jsonObject.optString("drivingpermitface"));
            model.setDriveback(jsonObject.optString("driveback"));
            model.setEducation(jsonObject.optString("education"));
            model.setBankNumber(jsonObject.optString("bankNumber"));
            model.setAddresscount(jsonObject.optString("addresscount"));
            model.setToexamine(jsonObject.optString("toexamine"));
            model.setMerchanttype(jsonObject.optString("merchanttype"));

            list.add(model);
        } catch (JSONException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return list;
    }

    //消息
    public static List<MessageActivityModel> getMessage(
            String ULR) {
        if ("".equals(ULR)) {
            return null;
        }
        List<MessageActivityModel> list = new ArrayList<>();
        JSONArray jsonArray;
        try {
            jsonArray = new JSONArray(ULR);
            if (jsonArray.length() != 0) {
                for (int i = 0; i < jsonArray.length(); i++) {
                    JSONObject jsonObject = jsonArray.optJSONObject(i);
                    MessageActivityModel model = new MessageActivityModel();
                    model.setId(jsonObject.optString("id"));
                    model.setMsgtitle(jsonObject.optString("msgtitle"));
                    model.setMsgcontent(jsonObject.optString("msgcontent"));
                    model.setMsgstatus(jsonObject.optString("msgstatus"));
                    model.setAddtime(jsonObject.optString("addtime"));
                    list.add(model);
                }
                return list;
            }


        } catch (JSONException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return list;
    }

    //解析底层
    public static List<MerchantsTypeModel> getmerchanttype(
            String ULR) {
        if ("".equals(ULR)) {
            return null;
        }
        List<MerchantsTypeModel> list = new ArrayList<>();
        JSONObject jsonObject;
        try {
            jsonObject = new JSONObject(ULR);
            MerchantsTypeModel model = new MerchantsTypeModel();
            model.setError(jsonObject.optString("error"));
            model.setMssage(jsonObject.optString("mssage"));
            if (jsonObject.optString("result") != null) {//个人中心首页借口
                model.setResult(jsonObject.optString("result"));
            }
            list.add(model);
        } catch (JSONException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return list;
    }

    //商家中心类型
    public static List<MerchantsTypeModel> gettype(
            String ULR) {
        if ("".equals(ULR)) {
            return null;
        }
        List<MerchantsTypeModel> list = new ArrayList<>();
        JSONArray jsonArray;
        try {
            jsonArray = new JSONArray(ULR);
            if (jsonArray.length() != 0) {
                for (int i = 0; i < jsonArray.length(); i++) {
                    JSONObject jsonObject = jsonArray.optJSONObject(i);
                    MerchantsTypeModel model = new MerchantsTypeModel();
                    model.setId(jsonObject.optString("id"));
                    model.setTypename(jsonObject.optString("typename"));
                    model.setIs_audit(jsonObject.optString("is_audit"));
                    list.add(model);
                }
                return list;
            }


        } catch (JSONException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return list;
    }

    //银行卡展示
    public static List<SelectBankCardModel> getBankCard(
            String ULR) {
        if ("".equals(ULR)) {
            return null;
        }
        List<SelectBankCardModel> list = new ArrayList<>();
        JSONArray jsonArray;
        try {
            jsonArray = new JSONArray(ULR);
            if (jsonArray.length() != 0) {
                for (int i = 0; i < jsonArray.length(); i++) {
                    JSONObject jsonObject = jsonArray.optJSONObject(i);
                    SelectBankCardModel model = new SelectBankCardModel();
                    model.setId(jsonObject.optString("id"));
                    model.setBanknumber(jsonObject.optString("banknumber"));
                    model.setBanklogo(jsonObject.optString("banklogo"));
                    model.setBankname(jsonObject.optString("bankname"));
                    model.setIs_default(jsonObject.optString("is_default"));
                    list.add(model);
                }
                return list;
            }


        } catch (JSONException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return list;
    }

    //学历
    public static List<EducationModel> getEducation(
            String ULR) {
        if ("".equals(ULR)) {
            return null;
        }
        List<EducationModel> list = new ArrayList<>();
        JSONObject jsonObject;
        try {
            jsonObject = new JSONObject(ULR);
            EducationModel model = new EducationModel();
            model.setEducation(jsonObject.optString("education"));
            model.setDegreetype(jsonObject.optString("degreetype"));

            model.setEnrolldate(jsonObject.optString("enrolldate"));
            model.setGradresult(jsonObject.optString("gradresult"));
            model.setGraddate(jsonObject.optString("graddate"));
            model.setMajor(jsonObject.optString("major"));
            model.setSchool(jsonObject.optString("school"));

            list.add(model);
        } catch (JSONException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return list;
    }

    //洗车地图
    public static List<BuyAcarModel> getWashTheCarMap(
            String ULR) {
        if ("".equals(ULR)) {
            return null;
        }
        List<BuyAcarModel> list = new ArrayList<>();
        JSONArray jsonArray;
        try {
            jsonArray = new JSONArray(ULR);
            if (jsonArray.length() != 0) {
                for (int i = 0; i < jsonArray.length(); i++) {
                    JSONObject jsonObject = jsonArray.optJSONObject(i);
                    BuyAcarModel model = new BuyAcarModel();
                    model.setLongitude(jsonObject.optString("longitude"));
                    model.setLatitude(jsonObject.optString("latitude"));
                    model.setSuite(jsonObject.optString("suite"));
                    list.add(model);
                }
                return list;
            }


        } catch (JSONException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return list;
    }

    //收货地址展示
    public static List<ShippingAddressModel> getShippingAddress(
            String ULR) {
        if ("".equals(ULR)) {
            return null;
        }
        List<ShippingAddressModel> list = new ArrayList<>();
        JSONArray jsonArray;
        try {
            jsonArray = new JSONArray(ULR);
            if (jsonArray.length() != 0) {
                for (int i = 0; i < jsonArray.length(); i++) {
                    JSONObject jsonObject = jsonArray.optJSONObject(i);
                    ShippingAddressModel model = new ShippingAddressModel();
                    model.setId(jsonObject.optString("id"));
                    model.setConsignee(jsonObject.optString("consignee"));
                    model.setSex(jsonObject.optString("sex"));
                    model.setUserphone(jsonObject.optString("userphone"));
                    model.setDetailedadd(jsonObject.optString("detailedadd"));
                    model.setIs_default(jsonObject.optString("is_default"));

                    model.setProvince(jsonObject.optString("province"));
                    model.setCity(jsonObject.optString("city"));
                    model.setArea(jsonObject.optString("area"));

                    model.setLongitude(jsonObject.optString("longitude"));
                    model.setLatitude(jsonObject.optString("latitude"));
                    list.add(model);
                }
                return list;
            }
        } catch (JSONException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return list;
    }

    //客户问题信息
    public static List<CustomerServiceCenterModel> getproblem(
            String ULR) {
        if ("".equals(ULR)) {
            return null;
        }
        List<CustomerServiceCenterModel> list = new ArrayList<>();
        JSONArray jsonArray;
        try {
            jsonArray = new JSONArray(ULR);
            if (jsonArray.length() != 0) {
                for (int i = 0; i < jsonArray.length(); i++) {
                    JSONObject jsonObject = jsonArray.optJSONObject(i);
                    CustomerServiceCenterModel model = new CustomerServiceCenterModel();
                    model.setId(jsonObject.optString("id"));
                    model.setQuestion(jsonObject.optString("question"));
                    model.setAnswer(jsonObject.optString("answer"));
                    model.setAdd_time(jsonObject.optString("add_time"));
                    list.add(model);
                }
                return list;
            }
        } catch (JSONException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return list;
    }

    //客户信息
    public static List<CustomerServiceCenterModel> getinfo(
            String ULR) {
        if ("".equals(ULR)) {
            return null;
        }
        List<CustomerServiceCenterModel> list = new ArrayList<>();
        JSONObject jsonObject;
        try {
            jsonObject = new JSONObject(ULR);
            CustomerServiceCenterModel model = new CustomerServiceCenterModel();
            model.setCustomerservice(jsonObject.optString("customerservice"));
            model.setServicetime(jsonObject.optString("servicetime"));
            list.add(model);
        } catch (JSONException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return list;
    }

    //签到详情
    public static List<SignIntegralModel> getSignIntegral(
            String ULR) {
        if ("".equals(ULR)) {
            return null;
        }
        List<SignIntegralModel> list = new ArrayList<>();
        JSONArray jsonArray;
        try {
            jsonArray = new JSONArray(ULR);
            if (jsonArray.length() != 0) {
                for (int i = 0; i < jsonArray.length(); i++) {
                    JSONObject jsonObject = jsonArray.optJSONObject(i);
                    SignIntegralModel model = new SignIntegralModel();
                    model.setVariablecontent(jsonObject.optString("variablecontent"));
                    model.setRemarks(jsonObject.optString("remarks"));
                    model.setDirectionofchange(jsonObject.optString("directionofchange"));
                    model.setAddtime(jsonObject.optString("addtime"));
                    list.add(model);
                }
                return list;
            }
        } catch (JSONException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return list;
    }

    //商家中心我的申请
    public static List<ApplyForEntryStatusModel> getmybusiness(
            String ULR) {
        if ("".equals(ULR)) {
            return null;
        }
        List<ApplyForEntryStatusModel> list = new ArrayList<>();
        JSONObject jsonObject;
        try {
            jsonObject = new JSONObject(ULR);
            ApplyForEntryStatusModel model = new ApplyForEntryStatusModel();
            model.setName(jsonObject.optString("name"));
            model.setApplytime(jsonObject.optString("applytime"));
            model.setToexamine(jsonObject.optString("toexamine"));
            model.setReject(jsonObject.optString("reject"));
            model.setRejecttime(jsonObject.optString("rejecttime"));
            model.setStateb(jsonObject.optString("stateb"));
            model.setMerchanttype(jsonObject.optString("merchanttype"));
            model.setId(jsonObject.optString("id"));
            list.add(model);

            return list;


        } catch (JSONException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return list;
    }

    //商家中心我的申请详情
    public static List<ApplicationModel> getbusiness(
            String ULR) {
        if ("".equals(ULR)) {
            return null;
        }
        List<ApplicationModel> list = new ArrayList<>();
        JSONObject jsonObject;
        try {
            jsonObject = new JSONObject(ULR);
            ApplicationModel model = new ApplicationModel();
            model.setName(jsonObject.optString("name"));
            model.setLegalname(jsonObject.optString("legalname"));
            model.setPhone(jsonObject.optString("phone"));
            model.setProvince(jsonObject.optString("province"));
            model.setCity(jsonObject.optString("city"));
            model.setDist(jsonObject.optString("dist"));
            model.setLongitude(jsonObject.optString("longitude"));
            model.setLatitude(jsonObject.optString("latitude"));
            model.setMerchanttype(jsonObject.optString("merchanttype"));
            model.setEmail(jsonObject.optString("email"));

            model.setLicense(jsonObject.optString("license"));
            model.setIdcardfront(jsonObject.optString("idcardfront"));
            model.setIdcardreverse(jsonObject.optString("idcardreverse"));
            model.setSuite(jsonObject.optString("suite"));
            model.setBeinvitedcode(jsonObject.optString("beinvitedcode"));
            model.setIdcardno(jsonObject.optString("idcardno"));

            if (jsonObject.optString("profile") != null) {
                model.setProfile(jsonObject.optString("profile"));
            }
            if (jsonObject.optString("invitecode") != null) {
                model.setInvitecode(jsonObject.optString("invitecode"));
            }


            list.add(model);

            return list;
        } catch (JSONException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return list;
    }

    //查看红包
    public static List<RedPacketsModel> getviewredpackets(
            String ULR) {
        if ("".equals(ULR)) {
            return null;
        }
        List<RedPacketsModel> list = new ArrayList<>();
        JSONArray jsonArray;
        try {
            jsonArray = new JSONArray(ULR);
            if (jsonArray.length() != 0) {
                for (int i = 0; i < jsonArray.length(); i++) {
                    JSONObject jsonObject = jsonArray.optJSONObject(i);
                    RedPacketsModel model = new RedPacketsModel();
                    model.setAmountofmoney(jsonObject.optString("amountofmoney"));
                    model.setRedenvelopes(jsonObject.optString("redenvelopes"));
                    model.setChangetype(jsonObject.optString("changetype"));
                    model.setAddtimes(jsonObject.optString("addtimes"));
                    list.add(model);
                }
                return list;
            }
        } catch (JSONException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return list;
    }

    //授信积分
    public static List<SignIntegralModel> getcreditScore(
            String ULR) {
        if ("".equals(ULR)) {
            return null;
        }
        List<SignIntegralModel> list = new ArrayList<>();
        JSONArray jsonArray;
        try {
            jsonArray = new JSONArray(ULR);
            if (jsonArray.length() != 0) {
                for (int i = 0; i < jsonArray.length(); i++) {
                    JSONObject jsonObject = jsonArray.optJSONObject(i);
                    SignIntegralModel model = new SignIntegralModel();
                    model.setChangenum(jsonObject.optString("changenum"));
                    model.setRemarks(jsonObject.optString("remarks"));
                    model.setDirectionofchange(jsonObject.optString("directionofchange"));
                    model.setAddtime(jsonObject.optString("addtime"));
                    list.add(model);
                }
                return list;
            }
        } catch (JSONException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return list;
    }


    //收藏
    public static List<CollectionModel> getcollection(
            String ULR) {
        if ("".equals(ULR)) {
            return null;
        }
        List<CollectionModel> list = new ArrayList<>();
        JSONArray jsonArray;
        try {
            jsonArray = new JSONArray(ULR);
            if (jsonArray.length() != 0) {
                for (int i = 0; i < jsonArray.length(); i++) {
                    JSONObject jsonObject = jsonArray.optJSONObject(i);
                    CollectionModel model = new CollectionModel();
                    model.setId(jsonObject.optString("id"));
                    model.setCredit_id(jsonObject.optString("credit_id"));
                    model.setAddtime(jsonObject.optString("addtime"));
                    model.setCredit_title(jsonObject.optString("credit_title"));
                    model.setSubject(jsonObject.optString("subject"));
                    model.setClassname(jsonObject.optString("classname"));
                    list.add(model);
                }
                return list;
            }
        } catch (JSONException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return list;
    }

    //商品中心
    public static List<BusinessCenterModel> getBusiness(
            String ULR) {
        if ("".equals(ULR)) {
            return null;
        }
        List<BusinessCenterModel> list = new ArrayList<>();
        JSONObject jsonObject;
        try {
            jsonObject = new JSONObject(ULR);
            BusinessCenterModel model = new BusinessCenterModel();
            model.setMerchant(jsonObject.optString("merchant"));
            if (jsonObject.optString("wjcorder") != null) {
                model.setWjcorder(jsonObject.optString("wjcorder"));
            }
            if (jsonObject.optString("yjorder") != null) {
                model.setYjorder(jsonObject.optString("yjorder"));
            }
            if (jsonObject.optString("counttodayincome") != null) {
                model.setCounttodayincome(jsonObject.optString("counttodayincome"));
            }
            if (jsonObject.optString("todayincome") != null) {
                model.setTodayincome(jsonObject.optString("todayincome"));
            }

            if (jsonObject.optString("wcorder") != null) {
                model.setWcorder(jsonObject.optString("wcorder"));
            }

            if (jsonObject.optString("totalmoney") != null) {
                model.setTotalmoney(jsonObject.optString("totalmoney"));
            }

            if (jsonObject.optString("shopcomment") != null) {
                model.setShopcomment(jsonObject.optString("shopcomment"));
            }

            if (jsonObject.optString("usermoney") != null) {
                model.setUsermoney(jsonObject.optString("usermoney"));
            }

            if (jsonObject.optString("tgcountuser") != null) {
                model.setTgcountuser(jsonObject.optString("tgcountuser"));
            }
            if (jsonObject.optString("horseman") != null) {
                model.setHorseman(jsonObject.optString("horseman"));
            }

            list.add(model);
        } catch (JSONException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return list;
    }

    //商品中心merchant数据
    public static List<BusinessCenterModel> getBusinessmerchant(
            String ULR) {
        if ("".equals(ULR)) {
            return null;
        }
        List<BusinessCenterModel> list = new ArrayList<>();
        JSONObject jsonObject;
        try {
            jsonObject = new JSONObject(ULR);
            BusinessCenterModel model = new BusinessCenterModel();
            model.setId(jsonObject.optString("id"));
            model.setName(jsonObject.optString("name"));
            model.setIson(jsonObject.optString("ison"));
            model.setStar(jsonObject.optString("star"));
            model.setAutomatic(jsonObject.optString("automatic"));

            list.add(model);
        } catch (JSONException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return list;
    }

    //图片管理
    public static List<ImageManagementModel> getmarkepic(
            String ULR) {
        if ("".equals(ULR)) {
            return null;
        }
        List<ImageManagementModel> list = new ArrayList<>();
        JSONObject jsonObject;
        try {
            jsonObject = new JSONObject(ULR);
            ImageManagementModel model = new ImageManagementModel();
            model.setFigurepic(jsonObject.optString("figurepic"));
            model.setListpic(jsonObject.optString("listpic"));
            list.add(model);
        } catch (JSONException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return list;
    }

    //商家中心评论
    public static List<AllEvaluationModel> getAllEvaluation(
            String ULR) {
        if ("".equals(ULR)) {
            return null;
        }
        List<AllEvaluationModel> list = new ArrayList<>();
        JSONObject jsonObject;
        try {
            jsonObject = new JSONObject(ULR);
            AllEvaluationModel model = new AllEvaluationModel();
            model.setComment(jsonObject.optString("comment"));
            model.setCommentcount(jsonObject.optString("commentcount"));
            list.add(model);
        } catch (JSONException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return list;
    }

    //商家中心评论 Comment
    public static List<AllEvaluationModel> getAllEvaluationComment(
            String ULR) {
        if ("".equals(ULR)) {
            return null;
        }
        List<AllEvaluationModel> list = new ArrayList<>();
        JSONArray jsonArray;
        try {
            jsonArray = new JSONArray(ULR);
            if (jsonArray.length() != 0) {
                for (int i = 0; i < jsonArray.length(); i++) {
                    JSONObject jsonObject = jsonArray.optJSONObject(i);
                    AllEvaluationModel model = new AllEvaluationModel();
                    model.setStar(jsonObject.optString("star"));
                    model.setComment(jsonObject.optString("comment"));
                    model.setCommenttime(jsonObject.optString("commenttime"));
                    model.setNickname(jsonObject.optString("nickname"));
                    model.setPhone(jsonObject.optString("phone"));
                    model.setAvatar(jsonObject.optString("avatar"));
                    list.add(model);
                }
                return list;
            }
        } catch (JSONException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return list;
    }

    //商家中心评论 Commentcount
    public static List<AllEvaluationModel> getAllEvaluationCommentcount(
            String ULR) {
        if ("".equals(ULR)) {
            return null;
        }
        List<AllEvaluationModel> list = new ArrayList<>();
        JSONObject jsonObject;
        try {
            jsonObject = new JSONObject(ULR);
            AllEvaluationModel model = new AllEvaluationModel();
            model.setCount(jsonObject.optString("count"));
            model.setEvaluate(jsonObject.optString("evaluate"));
            list.add(model);
        } catch (JSONException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return list;
    }

    //干洗-类别
    public static List<UniversalModel> getclasstype(
            String ULR) {
        if ("".equals(ULR)) {
            return null;
        }
        List<UniversalModel> list = new ArrayList<>();
        JSONArray jsonArray;
        try {
            jsonArray = new JSONArray(ULR);
            if (jsonArray.length() != 0) {
                for (int i = 0; i < jsonArray.length(); i++) {
                    JSONObject jsonObject = jsonArray.optJSONObject(i);
                    UniversalModel model = new UniversalModel();
                    model.setId(jsonObject.optString("id"));
                    model.setName(jsonObject.optString("name"));
                    list.add(model);
                }
                return list;
            }
        } catch (JSONException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return list;
    }

    //干洗-商家管理
    public static List<CommodityManagementModel> getcleaning(
            String ULR) {
        if ("".equals(ULR)) {
            return null;
        }
        List<CommodityManagementModel> list = new ArrayList<>();
        JSONArray jsonArray;
        try {
            jsonArray = new JSONArray(ULR);
            if (jsonArray.length() != 0) {
                for (int i = 0; i < jsonArray.length(); i++) {
                    JSONObject jsonObject = jsonArray.optJSONObject(i);
                    CommodityManagementModel model = new CommodityManagementModel();
                    model.setList(jsonObject.optString("list"));
                    model.setName(jsonObject.optString("name"));
                    list.add(model);
                }
                return list;
            }
        } catch (JSONException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return list;
    }

    //干洗-商家管理list
    public static List<CommodityManagementModel> getcleaningList(
            String ULR) {
        if ("".equals(ULR)) {
            return null;
        }
        List<CommodityManagementModel> list = new ArrayList<>();
        JSONArray jsonArray;
        try {
            jsonArray = new JSONArray(ULR);
            if (jsonArray.length() != 0) {
                for (int i = 0; i < jsonArray.length(); i++) {
                    JSONObject jsonObject = jsonArray.optJSONObject(i);
                    CommodityManagementModel model = new CommodityManagementModel();
                    model.setId(jsonObject.optString("id"));
                    model.setName(jsonObject.optString("name"));
                    model.setPrice(jsonObject.optString("price"));
                    model.setAudit(jsonObject.optString("audit"));
                    model.setAdd_time(jsonObject.optString("add_time"));
                    model.setIsdisplay(jsonObject.optString("isdisplay"));
                    model.setOrder(jsonObject.optString("order"));
                    model.setClassid(jsonObject.optString("classid"));
                    model.setIntroduction(jsonObject.optString("introduction"));
                    model.setReject(jsonObject.optString("reject"));
                    model.setRejecttime(jsonObject.optString("rejecttime"));
                    model.setImg(jsonObject.optString("img"));
                    list.add(model);
                }
                return list;
            }
        } catch (JSONException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return list;
    }

    //洗车-商家管理list
    public static List<CommodityManagementModel> getWashcarList(
            String ULR) {
        if ("".equals(ULR)) {
            return null;
        }
        List<CommodityManagementModel> list = new ArrayList<>();
        JSONArray jsonArray;
        try {
            jsonArray = new JSONArray(ULR);
            if (jsonArray.length() != 0) {
                for (int i = 0; i < jsonArray.length(); i++) {
                    JSONObject jsonObject = jsonArray.optJSONObject(i);
                    CommodityManagementModel model = new CommodityManagementModel();
                    model.setId(jsonObject.optString("id"));
                    model.setIntro(jsonObject.optString("intro"));
                    model.setLimousine(jsonObject.optString("limousine"));
                    model.setLimousineprice(jsonObject.optString("limousineprice"));
                    model.setLimousinediudiuprice(jsonObject.optString("limousinediudiuprice"));
                    model.setSuv(jsonObject.optString("suv"));
                    model.setSuvprice(jsonObject.optString("suvprice"));
                    model.setSuvdiudiuprice(jsonObject.optString("suvdiudiuprice"));
                    model.setTaxi(jsonObject.optString("taxi"));
                    model.setTaxiprice(jsonObject.optString("taxiprice"));
                    model.setTaxidiudiuprice(jsonObject.optString("taxidiudiuprice"));
                    model.setAudited(jsonObject.optString("audited"));
                    model.setUpframe(jsonObject.optString("upframe"));
                    model.setReject(jsonObject.optString("reject"));
                    model.setRejecttime(jsonObject.optString("rejecttime"));
                    model.setApplytime(jsonObject.optString("applytime"));
                    model.setOrder(jsonObject.optString("order"));
                    model.setClassid(jsonObject.optString("classid"));
                    list.add(model);
                }
                return list;
            }
        } catch (JSONException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return list;
    }

    //购车-商家管理
    public static List<CommodityManagementModel> getcar(
            String ULR) {
        if ("".equals(ULR)) {
            return null;
        }
        List<CommodityManagementModel> list = new ArrayList<>();
        JSONArray jsonArray;
        try {
            jsonArray = new JSONArray(ULR);
            if (jsonArray.length() != 0) {
                for (int i = 0; i < jsonArray.length(); i++) {
                    JSONObject jsonObject = jsonArray.optJSONObject(i);
                    CommodityManagementModel model = new CommodityManagementModel();
                    model.setId(jsonObject.optString("id"));
                    model.setIntro(jsonObject.optString("intro"));
                    model.setBrand(jsonObject.optString("brand"));
                    model.setSellingprice(jsonObject.optString("sellingprice"));
                    model.setDetailsa(jsonObject.optString("detailsa"));
                    model.setApplytime(jsonObject.optString("applytime"));
                    model.setOrder(jsonObject.optString("order"));
                    model.setUpframe(jsonObject.optString("upframe"));
                    model.setAudited(jsonObject.optString("audited"));
                    model.setReject(jsonObject.optString("reject"));
                    model.setRejecttime(jsonObject.optString("rejecttime"));
                    model.setSelected(jsonObject.optString("selected"));

                    list.add(model);
                }
                return list;
            }
        } catch (JSONException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return list;
    }

    //家政-商家管理
    public static List<CommodityManagementModel> gethomemaking(
            String ULR) {
        if ("".equals(ULR)) {
            return null;
        }
        List<CommodityManagementModel> list = new ArrayList<>();
        JSONArray jsonArray;
        try {
            jsonArray = new JSONArray(ULR);
            if (jsonArray.length() != 0) {
                for (int i = 0; i < jsonArray.length(); i++) {
                    JSONObject jsonObject = jsonArray.optJSONObject(i);
                    CommodityManagementModel model = new CommodityManagementModel();
                    model.setId(jsonObject.optString("id"));
                    model.setClassname(jsonObject.optString("classname"));
                    model.setPrice(jsonObject.optString("price"));
                    model.setAudit(jsonObject.optString("audit"));
                    model.setAdd_time(jsonObject.optString("add_time"));
                    model.setIsdisplay(jsonObject.optString("isdisplay"));
                    model.setOrder(jsonObject.optString("order"));
                    model.setTimetype(jsonObject.optString("timetype"));
                    model.setSynopsis(jsonObject.optString("synopsis"));
                    model.setReject(jsonObject.optString("reject"));
                    model.setRejecttime(jsonObject.optString("rejecttime"));
                    model.setServicetime(jsonObject.optString("servicetime"));
                    model.setDirectionidname(jsonObject.optString("directionidname"));
                    model.setDirectionid(jsonObject.optString("directionid"));
                    model.setProportion(jsonObject.optString("proportion"));
                    list.add(model);
                }
                return list;
            }
        } catch (JSONException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return list;
    }

    //买房-商家管理
    public static List<CommodityManagementModel> getbuyhouse(
            String ULR) {
        if ("".equals(ULR)) {
            return null;
        }
        List<CommodityManagementModel> list = new ArrayList<>();
        JSONArray jsonArray;
        try {
            jsonArray = new JSONArray(ULR);
            if (jsonArray.length() != 0) {
                for (int i = 0; i < jsonArray.length(); i++) {
                    JSONObject jsonObject = jsonArray.optJSONObject(i);
                    CommodityManagementModel model = new CommodityManagementModel();
                    model.setId(jsonObject.optString("id"));
                    model.setTitle(jsonObject.optString("title"));
                    model.setPrice(jsonObject.optString("price"));
                    model.setIs_audit(jsonObject.optString("is_audit"));
                    model.setAddtime(jsonObject.optString("addtime"));
                    model.setIs_play(jsonObject.optString("is_play"));
                    model.setType(jsonObject.optString("type"));
                    model.setAddress(jsonObject.optString("address"));
                    model.setReject(jsonObject.optString("reject"));
                    model.setRejecttime(jsonObject.optString("rejecttime"));
                    model.setNumber(jsonObject.optString("number"));
                    list.add(model);
                }
                return list;
            }
        } catch (JSONException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return list;
    }

    //家政-类别与方向
    public static List<UniversalModel> getgenretype(
            String ULR) {
        if ("".equals(ULR)) {
            return null;
        }
        List<UniversalModel> list = new ArrayList<>();
        JSONObject jsonObject;
        try {
            jsonObject = new JSONObject(ULR);

            UniversalModel model = new UniversalModel();
            model.setClassification(jsonObject.optString("classification"));
            model.setDirection(jsonObject.optString("direction"));
            list.add(model);

            return list;

        } catch (JSONException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return list;
    }

    //订单管理 商家中心
    public static List<WaitingModel> getwjcleaningorder(
            String ULR) {
        if ("".equals(ULR)) {
            return null;
        }
        List<WaitingModel> list = new ArrayList<>();
        JSONArray jsonArray;
        try {
            jsonArray = new JSONArray(ULR);
            if (jsonArray.length() != 0) {
                for (int i = 0; i < jsonArray.length(); i++) {
                    JSONObject jsonObject = jsonArray.optJSONObject(i);
                    WaitingModel model = new WaitingModel();
                    model.setId(jsonObject.optString("id"));
                    model.setOrdername(jsonObject.optString("ordername"));
                    model.setOrdernumber(jsonObject.optString("ordernumber"));
                    model.setAddtime(jsonObject.optString("addtime"));
                    if (jsonObject.optString("ordermoney") != null) {
                        model.setOrdermoney(jsonObject.optString("ordermoney"));
                    }
                    if (jsonObject.optString("timetype") != null) {
                        model.setServicetime(jsonObject.optString("timetype"));
                    }
                    if (jsonObject.optString("details") != null) {
                        model.setDetails(jsonObject.optString("details"));
                    }

                    if (jsonObject.optString("orderstate") != null) {
                        model.setOrderstate(jsonObject.optString("orderstate"));
                    }
                    list.add(model);
                }
                return list;
            }
        } catch (JSONException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return list;
    }

    //订单管理 商家中心
    public static List<WaitingModel> getwjcleaningorderdetails(
            String ULR) {
        if ("".equals(ULR)) {
            return null;
        }
        List<WaitingModel> list = new ArrayList<>();
        JSONArray jsonArray;
        try {
            jsonArray = new JSONArray(ULR);
            if (jsonArray.length() != 0) {
                for (int i = 0; i < jsonArray.length(); i++) {
                    JSONObject jsonObject = jsonArray.optJSONObject(i);
                    WaitingModel model = new WaitingModel();
                    model.setProductname(jsonObject.optString("productname"));
                    model.setUnitprice(jsonObject.optString("unitprice"));
                    model.setQuantity(jsonObject.optString("quantity"));
                    list.add(model);
                }
                return list;
            }
        } catch (JSONException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return list;
    }

    //新房详情
    public static List<AddThePropertyModel> getdetails(
            String ULR) {
        if ("".equals(ULR)) {
            return null;
        }
        List<AddThePropertyModel> list = new ArrayList<>();
        JSONObject jsonObject;
        try {
            jsonObject = new JSONObject(ULR);

            AddThePropertyModel model = new AddThePropertyModel();
            model.setList(jsonObject.optString("list"));
            model.setHometype(jsonObject.optString("hometype"));

            list.add(model);

            return list;

        } catch (JSONException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return list;
    }

    //新房详情list
    public static List<AddThePropertyModel> getdetailslist(
            String ULR) {
        if ("".equals(ULR)) {
            return null;
        }
        List<AddThePropertyModel> list = new ArrayList<>();
        JSONObject jsonObject;
        try {
            jsonObject = new JSONObject(ULR);

            AddThePropertyModel model = new AddThePropertyModel();
            model.setId(jsonObject.optString("id"));
            model.setTitle(jsonObject.optString("title"));
            model.setType(jsonObject.optString("type"));
            model.setPrice(jsonObject.optString("price"));
            model.setFitmentfinish(jsonObject.optString("fitmentfinish"));
            model.setOrientation(jsonObject.optString("orientation"));
            model.setProfile(jsonObject.optString("profile"));
            model.setAddress(jsonObject.optString("address"));
            model.setContacttel(jsonObject.optString("contacttel"));
            model.setQuotationtime(jsonObject.optString("quotationtime"));
            model.setOtherstime(jsonObject.optString("otherstime"));
            model.setCturetype(jsonObject.optString("cturetype"));
            model.setLayout(jsonObject.optString("layout"));
            model.setCarport(jsonObject.optString("carport"));
            model.setPlotratio(jsonObject.optString("plotratio"));
            model.setQujian(jsonObject.optString("qujian"));
            model.setLabelling(jsonObject.optString("labelling"));
            model.setGreeningrate(jsonObject.optString("greeningrate"));
            model.setHomepic(jsonObject.optString("homepic"));
            model.setLongitude(jsonObject.optString("longitude"));
            model.setLatitude(jsonObject.optString("latitude"));
            model.setPhone(jsonObject.optString("phone"));
            model.setName(jsonObject.optString("name"));
            model.setKm(jsonObject.optString("km"));
            model.setIscharge(jsonObject.optString("ischarge"));
            model.setChargesum(jsonObject.optString("chargesum"));
            list.add(model);

            return list;

        } catch (JSONException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return list;
    }

    //查询我的楼盘户型
    public static List<FamilyManagementModel> gethometype(
            String ULR) {
        if ("".equals(ULR)) {
            return null;
        }
        List<FamilyManagementModel> list = new ArrayList<>();
        JSONArray jsonArray;
        try {
            jsonArray = new JSONArray(ULR);
            if (jsonArray.length() != 0) {
                for (int i = 0; i < jsonArray.length(); i++) {
                    JSONObject jsonObject = jsonArray.optJSONObject(i);
                    FamilyManagementModel model = new FamilyManagementModel();
                    model.setId(jsonObject.optString("id"));
                    model.setRid(jsonObject.optString("rid"));
                    model.setArea(jsonObject.optString("area"));
                    model.setFtype(jsonObject.optString("ftype"));
                    model.setPicimage(jsonObject.optString("picimage"));
                    list.add(model);
                }
                return list;
            }
        } catch (JSONException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return list;
    }

    //商家中心订单详情
    public static List<OrderDetailsModel> getOrderdetails(
            String ULR) {
        if ("".equals(ULR)) {
            return null;
        }
        List<OrderDetailsModel> list = new ArrayList<>();
        JSONObject jsonObject;
        try {
            jsonObject = new JSONObject(ULR);
            OrderDetailsModel model = new OrderDetailsModel();
            model.setDetails(jsonObject.optString("details"));
            model.setHorseman(jsonObject.optString("horseman"));
            model.setComment(jsonObject.optString("comment"));

            list.add(model);
        } catch (JSONException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return list;
    }

    //商家中心订单详情 details
    public static List<OrderDetailsModel> getOrderdetailsdetails(
            String ULR) {
        if ("".equals(ULR)) {
            return null;
        }
        List<OrderDetailsModel> list = new ArrayList<>();
        JSONObject jsonObject;
        try {
            jsonObject = new JSONObject(ULR);
            OrderDetailsModel model = new OrderDetailsModel();
            model.setOrdernumber(jsonObject.optString("ordernumber"));
            model.setAddtime(jsonObject.optString("addtime"));
            model.setOrdertype(jsonObject.optString("ordertype"));

            model.setAddress(jsonObject.optString("address"));
            if (jsonObject.optString("distname") != null) {
                model.setDistname(jsonObject.optString("distname"));
            }
            if (jsonObject.optString("disttel") != null) {
                model.setDisttel(jsonObject.optString("disttel"));
            }
            if (jsonObject.optString("consignee") != null) {
                model.setConsignee(jsonObject.optString("consignee"));
            }
            if (jsonObject.optString("consignee") != null) {
                model.setPhone(jsonObject.optString("phone"));
            }
            model.setOddnum(jsonObject.optString("oddnum"));
            model.setRemark(jsonObject.optString("remark"));

            list.add(model);
        } catch (JSONException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return list;
    }

    //商家中心订单详情 horseman
    public static List<OrderDetailsModel> getOrderdetailshorseman(
            String ULR) {
        if ("".equals(ULR)) {
            return null;
        }
        List<OrderDetailsModel> list = new ArrayList<>();
        JSONObject jsonObject;
        try {
            jsonObject = new JSONObject(ULR);
            OrderDetailsModel model = new OrderDetailsModel();
            model.setPhone(jsonObject.optString("phone"));
            model.setRealname(jsonObject.optString("realname"));
            model.setAvatar(jsonObject.optString("avatar"));


            list.add(model);
        } catch (JSONException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return list;
    }

    //商家中心订单详情 comment
    public static List<OrderDetailsModel> getOrderdetailscomment(
            String ULR) {
        if ("".equals(ULR)) {
            return null;
        }
        List<OrderDetailsModel> list = new ArrayList<>();
        JSONObject jsonObject;
        try {
            jsonObject = new JSONObject(ULR);
            OrderDetailsModel model = new OrderDetailsModel();
            model.setStar(jsonObject.optString("star"));
            model.setComment(jsonObject.optString("comment"));
            list.add(model);
        } catch (JSONException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return list;
    }

    //商家中心订单详情 家政
    public static List<OrderDetailsModel> getOrderdhomemaking(
            String ULR) {
        if ("".equals(ULR)) {
            return null;
        }
        List<OrderDetailsModel> list = new ArrayList<>();
        JSONObject jsonObject;
        try {
            jsonObject = new JSONObject(ULR);
            OrderDetailsModel model = new OrderDetailsModel();
            model.setId(jsonObject.optString("id"));
            model.setOrdername(jsonObject.optString("ordername"));
            model.setAddtime(jsonObject.optString("addtime"));

            model.setOrdermoney(jsonObject.optString("ordermoney"));

            model.setPayment(jsonObject.optString("payment"));


            model.setOrdernumber(jsonObject.optString("ordernumber"));


            if (jsonObject.optString("person") != null) {
                model.setPerson(jsonObject.optString("person"));
            }
            if (jsonObject.optString("remaek") != null) {
                model.setRemaek(jsonObject.optString("remaek"));
            }
            if (jsonObject.optString("address") != null) {
                model.setAddress(jsonObject.optString("address"));
            }
            if (jsonObject.optString("consignee") != null) {
                model.setConsignee(jsonObject.optString("consignee"));
            }
            if (jsonObject.optString("tel") != null) {
                model.setTel(jsonObject.optString("tel"));
            }
            model.setPhone(jsonObject.optString("phone"));
            model.setComment(jsonObject.optString("comment"));

            if (jsonObject.optString("ischarge") != null) {
                model.setIscharge(jsonObject.optString("ischarge"));
            }
            if (jsonObject.optString("detailedaddress") != null) {
                model.setDetailedaddress(jsonObject.optString("detailedaddress"));
            }

            list.add(model);
        } catch (JSONException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return list;
    }

    //商家中心订单详情 苦力
    public static List<OrderDetailsModel> getOrderdcoolie(
            String ULR) {
        if ("".equals(ULR)) {
            return null;
        }
        List<OrderDetailsModel> list = new ArrayList<>();
        JSONObject jsonObject;
        try {
            jsonObject = new JSONObject(ULR);
            OrderDetailsModel model = new OrderDetailsModel();
            model.setId(jsonObject.optString("id"));
            model.setOrdernumber(jsonObject.optString("ordernumber"));
            model.setAddtime(jsonObject.optString("addtime"));
            model.setOrdername(jsonObject.optString("ordername"));
            model.setOrdermoney(jsonObject.optString("ordermoney"));
            model.setQuaddress(jsonObject.optString("quaddress"));
            model.setQuhousnum(jsonObject.optString("quhousnum"));
            model.setGoaddress(jsonObject.optString("goaddress"));
            model.setGonum(jsonObject.optString("gonum"));
            model.setGoname(jsonObject.optString("goname"));
            model.setGophone(jsonObject.optString("gophone"));
            model.setRemarks(jsonObject.optString("remarks"));
            model.setWeight(jsonObject.optString("weight"));
            model.setIscharge(jsonObject.optString("ischarge"));
            model.setPhone(jsonObject.optString("phone"));
            model.setComment(jsonObject.optString("comment"));
            list.add(model);
        } catch (JSONException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return list;
    }

    //我的租房资源
    public static List<HousingModel> getmyhousing(
            String ULR) {
        if ("".equals(ULR)) {
            return null;
        }
        List<HousingModel> list = new ArrayList<>();
        JSONArray jsonArray;
        try {
            jsonArray = new JSONArray(ULR);
            if (jsonArray.length() != 0) {
                for (int i = 0; i < jsonArray.length(); i++) {
                    JSONObject jsonObject = jsonArray.optJSONObject(i);
                    HousingModel model = new HousingModel();
                    model.setId(jsonObject.optString("id"));
                    model.setTitle(jsonObject.optString("title"));
                    model.setCommunity(jsonObject.optString("community"));
                    model.setRoom(jsonObject.optString("room"));
                    model.setMode(jsonObject.optString("mode"));

                    model.setAudit(jsonObject.optString("audit"));
                    model.setMnthly(jsonObject.optString("mnthly"));
                    model.setRejecttext(jsonObject.optString("rejecttext"));
                    model.setRejecttime(jsonObject.optString("rejecttime"));
                    model.setRetype(jsonObject.optString("retype"));
                    model.setPic(jsonObject.optString("pic"));
                    list.add(model);
                }
                return list;
            }
        } catch (JSONException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return list;
    }

    /**
     *
     * @param ULR
     * @return
     */
    public static HomePageModel getHomePage(
            String ULR) {
        if ("".equals(ULR)) {
            return new HomePageModel();
        }
        Type type = new TypeToken<HomePageModel>(){}.getType();
        HomePageModel model = new Gson().fromJson(ULR, type);
        return model;
    }

}
